home *** CD-ROM | disk | FTP | other *** search
- /*********************************************************************
- ----------------------------------------------------------------------
-
- MysticView Global Data
-
- ------------------------------------------------------ tabsize = 4 ---
- *********************************************************************/
-
- #include <string.h>
-
- #include <exec/memory.h>
- #include <proto/exec.h>
- #include <proto/render.h>
- #include <render/render.h>
-
- #include "global.h"
-
- /*------------------------------------------------------------------*/
-
- static char versionstring[] = "$VER: " PROGNAME;
-
- /*------------------------------------------------------------------*/
-
- APTR memhandler;
- struct Library *RenderBase;
- struct Library *DataTypesBase;
-
- /*********************************************************************
- ----------------------------------------------------------------------
-
- BOOL InitGlobal(void)
-
- ----------------------------------------------------------------------
- *********************************************************************/
-
- BOOL InitGlobal(void)
- {
- /*
- * open render.library
- */
-
- if(RenderBase = OpenLibrary("render.library", RENDER_VERSION))
- {
-
- if(DataTypesBase = OpenLibrary("datatypes.library", 39L))
- {
-
- /*
- * create a global memory handler with render.library
- */
-
- if(memhandler = CreateRMHandler(RND_MemType, RMHTYPE_POOL, TAG_DONE))
- {
- return TRUE;
- }
- }
- }
-
- return FALSE;
- }
-
- /*********************************************************************
- ----------------------------------------------------------------------
-
- void CloseGlobal(void)
-
- ----------------------------------------------------------------------
- *********************************************************************/
-
- void CloseGlobal(void)
- {
- if (memhandler)
- {
- DeleteRMHandler(memhandler);
- }
-
- if (DataTypesBase)
- {
- CloseLibrary(DataTypesBase);
- }
-
- if (RenderBase)
- {
- CloseLibrary(RenderBase);
- }
-
- }
-
-
-
- /*********************************************************************
- ----------------------------------------------------------------------
-
- mem = AllocVecPooled(size)
-
- ----------------------------------------------------------------------
- *********************************************************************/
-
- APTR AllocVecPooled( ULONG allocsize )
- {
- return AllocRenderVec( memhandler, allocsize );
- }
-
-
- /*********************************************************************
- ----------------------------------------------------------------------
-
- FreeVecPooled(mem)
-
- ----------------------------------------------------------------------
- *********************************************************************/
-
- void FreeVecPooled( APTR memblock )
- {
- FreeRenderVec( memblock );
- }
-
-
-